-
Notifications
You must be signed in to change notification settings - Fork 59
Add the WASI runtime test target #977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASI/Arguments/DirectoryArgument.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASI/Arguments/ErrorPatternsFileArgument.cs
Outdated
Show resolved
Hide resolved
radical
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good first draft 👍
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASI/Arguments/ErrorPatternsFileArgument.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASI/Arguments/SymbolMapFileArgument.cs
Outdated
Show resolved
Hide resolved
| using System; | ||
| using System.IO; | ||
|
|
||
| namespace Microsoft.DotNet.XHarness.CLI.CommandArguments.Wasi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be duplicated, and can be shared by Wasi, and Wasm commands.
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASI/Arguments/SymbolicatorArgument.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/Commands/WASI/ErrorPatternScanner.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/Commands/WASI/Engine/WasiTestCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASI/Arguments/WasmEngineArgument.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASI/Arguments/LibraryArgument.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASI/Arguments/DirectoryArgument.cs
Outdated
Show resolved
Hide resolved
tests/Microsoft.DotNet.XHarness.CLI.Tests/Commands/XHarnessCommandTests.cs
Outdated
Show resolved
Hide resolved
radical
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking much better now! Some more feedback based on trying out the new command.
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASI/Arguments/WasmEngineArgument.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASI/WasiTestCommandArguments.cs
Outdated
Show resolved
Hide resolved
| public WasmEngineArgument Engine { get; } = new(); | ||
| public WasmEngineLocationArgument EnginePath { get; } = new(); | ||
| public WasmEngineArguments EngineArgs { get; } = new(); | ||
| public WasmFileArgument WasmFile { get; } = new("dotnet.wasm"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed. It can be specified as part of the pass through commands. For example:
xharness wasi test -- WasmTestRunner.wasm System.Collections.Tests.dll
All the arguments after -- are pass-through arguments, which will be passed to wasmtime as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could try to add https://wasmedge.org/ engine to see if they have same expectations
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASI/WasiTestCommandArguments.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/Commands/WASI/Engine/WasiTestCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/Commands/WASI/Engine/WasiTestCommand.cs
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/Commands/WASI/Engine/WasiTestCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/Commands/WASI/Engine/WasiTestCommand.cs
Show resolved
Hide resolved
|
It would be good to use |
| logger.LogInformation($"Using wasm engine {Arguments.Engine.Value} from path {engineBinary}"); | ||
| await PrintVersionAsync(Arguments.Engine.Value.Value, engineBinary); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move these inside the try/catch, so a missing engine error can be reported correctly. Do the same for WasmTestCommand.
| if (logProcessor.LineThatMatchedErrorPattern != null) | ||
| { | ||
| logger.LogError("Application exited with the expected exit code: {result.ExitCode}." | ||
| + $" But found a line matching an error pattern: {logProcessor.LineThatMatchedErrorPattern}"); | ||
| return ExitCode.APP_CRASH; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed because we are not using a error patterns scanner at all.
| var stdoutFilePath = Path.Combine(Arguments.OutputDirectory, "wasi-console.log"); | ||
| File.Delete(stdoutFilePath); | ||
|
|
||
| var logProcessor = new WasmTestMessagesProcessor(xmlResultsFilePath, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value for the last two parameters can be made null now.
radical
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the few comments, looks good 👍
radical
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 great job:)
pavelsavara
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Add WASI runtime as XHarness target